﻿using PFMCandidate;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PFMHandlers
{
    public class PFMHandler:IHandler
    {
        public byte[] bTarget { get; set; }
        public Candidate o_Cadidate { get; set; }
        public void CheckForDelete() { }
        //public byte[] GetProcessingData(Candidate aCandidate, byte[] baTarget) { return null; }
        public virtual byte[] Perform(Candidate aCandidate, byte[] baTarget) 
        { 
            this.bTarget = baTarget; 
            this.o_Cadidate = aCandidate;
            return null; 
        }
        protected byte[] GetProcessingData(Candidate aCandidate,byte []baTarget)
        {
            byte[] sResult = null;
            if(baTarget ==null)
            {
                PFMHandler aFileHandler = new PFMFileHandler();
                sResult = aFileHandler.Perform(aCandidate, null);
            }
            else
            {
                sResult = baTarget;
            }
            return sResult;
        }
      
    }
}
